﻿using Mes.Domain.BoundedContext.EntityBase;

namespace Mes.Domain.BoundedContext.Entities.Operations
{
    /// <summary>
    /// 工艺表
    /// Defines a method by which something is produced, and from which work orders may be instantiated
    /// </summary>
    public class Process : NoIdEntityBase
    {
        /// <summary>
        /// Identify a version of a process
        /// 主键
        /// </summary>
        public string Process_Id { get; set; } = string.Empty;

        /// <summary>
        /// 第一阶段暂不实现预留给第二阶段（avevames:porcess_class表主键）
        /// Of which process class this is a version
        /// </summary>
        public string Process_Class_Id { get; set; } = string.Empty;

        /// <summary>
        /// 工艺版本
        /// Identify the version
        /// </summary>
        public string Process_Ver_Id { get; set; }= string.Empty;

        /// <summary>
        /// 工艺描述
        /// Description of this process version
        /// </summary>
        public string Process_Desc { get; set; } = string.Empty;

        /// <summary>
        /// 工艺级别
        /// 1 = General, 2 = Site, 3 = Master 
        /// </summary>
        public int Process_Level { get; set; }

        /// <summary>
        /// 工艺状态
        /// -1 = Disabled, 1 = Experimental, 2 = Approved, 3 = Certified
        /// </summary>
        public int Process_Status { get; set; }

        /// <summary>
        /// 创建者
        /// User_id who created this process version
        /// </summary>
        public string Creator { get; set; } = string.Empty;

        /// <summary>
        /// User_id who approved this process version
        /// </summary>
        public string Approver { get; set; } = string.Empty;

        /// <summary>
        /// When this process version was created
        /// </summary>
        public DateTime Created_At { get; set; } = DateTime.Now;

        /// <summary>
        /// Last person who changed the status of this process version
        /// </summary>
        public string Last_User_To_Change_Status { get; set; } = string.Empty;

        /// <summary>
        /// When this process version?s status was last changed
        /// </summary>
        public DateTime Last_Status_Change_At { get; set; } = DateTime.Now;

        /// <summary>
        /// Who currently has this process version checked out
        /// </summary>
        public string Checked_Out_By { get; set; } = string.Empty;

        /// <summary>
        /// Record the last time the process was used to successfully create a work order.
        /// </summary>
        public DateTime Last_Instantiated { get; set; } = DateTime.Now;

        /// <summary>
        /// Is this process disassembling something into its components
        /// </summary>
        public bool Disassembly { get; set; }

        /// <summary>
        /// May operations be run out of sequence
        /// </summary>
        public bool May_Override_Route { get; set; }

        /// <summary>
        /// 返工
        /// </summary>
        public bool Rework { get; set; }

        /// <summary>
        /// Notes about this process
        /// </summary>
        public string Notes { get; set; } = string.Empty;

        /// <summary>
        /// Use defined by language term 5161
        /// </summary>
        public string Spare1 { get; set; } = string.Empty;

        /// <summary>
        /// Use defined by language term 5162
        /// </summary>
        public string Spare2 { get; set; } = string.Empty;

        /// <summary>
        /// Use defined by language term 5163
        /// </summary>
        public string Spare3 { get; set; } = string.Empty;

        /// <summary>
        /// Use defined by language term 5164
        /// </summary>
        public string Spare4 { get; set; } = string.Empty;

        /// <summary>
        /// Why record was changed
        /// </summary>
        public string Last_Edit_Comment { get; set; } = string.Empty;

        /// <summary>
        /// Who last changed record
        /// </summary>
        public string Last_Editor { get; set; } = string.Empty;

        /// <summary>
        /// When record last changed
        /// </summary>
        public DateTime Last_Edit_At { get; set; } = DateTime.Now;

        /// <summary>
        /// Changes when modified
        /// </summary>
        public long Mod_Id { get; set; }

        /// <summary>
        /// Unique row identifier, for audit trail
        /// </summary>
        public int Row_Id { get; set; }
    }
}
